home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Color;
- import java.awt.Dimension;
- import java.io.DataInputStream;
-
- public class CWindowAction extends CDisplayAction {
- static final int CHANGE_LAYER = 64;
- static final int FULL_SCREEN_CENTRED = 128;
- static final int OS_SIZE_AUTO = 1024;
- static final int OS_SIZE_FIXED = 2048;
- static final int BK_NONE = 65536;
- static final int BK_COLOUR = 16;
- static final int BK_FILE_CENTRE = 1048576;
- static final int BK_GRADIENT_HORIZ = 4194304;
- int m_nStyles = 0;
- int m_nFlags = 0;
- Dimension m_sizeOsBuffer = new Dimension();
- Dimension m_sizeAutoScroll = new Dimension();
- CByteArray m_byarrLockLayer = new CByteArray(11);
- Color m_dwBkColour = new Color(255, 255, 255);
- Color m_rgbFromColour = new Color(0, 255, 255);
- Color m_rgbToColour = new Color(0, 0, 0);
- CPicture m_Image = new CPicture();
-
- boolean DoAction() {
- boolean var1 = false;
- if (!Globals.thePresView.IsStopped()) {
- if ((this.m_nFlags & 16) != 0 && Globals.thePresView.SetOffScreenBufferBkColour(this.m_dwBkColour)) {
- var1 = true;
- }
-
- if ((this.m_nFlags & 128) != 0 && Globals.thePresView.ResizeWindow(((CDisplayAction)this).GetActualRect().width, ((CDisplayAction)this).GetActualRect().height)) {
- var1 = true;
- }
-
- Globals.thePresView.SetCurrentWindowAction(this);
- if (var1) {
- Globals.thePresView.InvalidateOffScreenRect((CRect)null);
- Globals.thePresView.RenderAndDrawDirtyList();
- }
- }
-
- return true;
- }
-
- boolean LoadFromFile(DataInputStream var1) {
- this.m_nStyles = FileLoad.ReadCPlusInt(var1);
- this.m_dwBkColour = FileLoad.ReadColor(var1);
- FileLoad.ReadCString(var1);
- this.m_sizeOsBuffer.width = FileLoad.ReadCPlusInt(var1);
- this.m_sizeOsBuffer.height = FileLoad.ReadCPlusInt(var1);
- this.m_sizeAutoScroll.width = FileLoad.ReadCPlusInt(var1);
- this.m_sizeAutoScroll.height = FileLoad.ReadCPlusInt(var1);
- this.m_nFlags = FileLoad.ReadCPlusInt(var1);
- if (Globals.CUR_COURSE.m_nFileVersion > 3) {
- this.m_rgbFromColour = FileLoad.ReadColor(var1);
- this.m_rgbToColour = FileLoad.ReadColor(var1);
- this.m_Image.LoadFromFile(var1);
- } else {
- this.m_nFlags |= 5242880;
- if ((this.m_nStyles & 16) != 0) {
- this.m_nFlags |= 16;
- } else {
- this.m_nFlags |= 65536;
- }
- }
-
- if ((this.m_nFlags & 64) != 0) {
- this.m_byarrLockLayer.LoadFromFile(var1);
- } else {
- CByteArray var2 = new CByteArray();
- var2.LoadFromFile(var1);
- }
-
- return super.LoadFromFile(var1);
- }
-
- boolean IsLayerLocked(short var1) {
- return var1 < this.m_byarrLockLayer.GetSize() && this.m_byarrLockLayer.GetAt(var1) != 0;
- }
-
- public CWindowAction() {
- super(9);
- }
- }
-